<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //1.函数参数的解构赋值
    const info = ({ age = 0, name = 'bb' }) => console.log(name, age);
    info({ name: 'aa', age: 18 })
    info({})
    //2.复杂的嵌套
    const obj = {
      x: 1,
      y: [1, 2, 3],
      z: {
        a: 5,
        b: 6
      }
    };
    console.log({ x, y, z } = obj);
    const {
      y:[,yy],
      z:{b}
    }=obj
    console.log(y);
    console.log(yy);
    console.log(b);
    console.log(z);
  </script>
</body>

</html>